compress([],[]):-!.
compress(L1,L2):- compress(L1,L2,_,[]).
compress([],L2,_,L2):-!.
compress([X|T],L2,H,Acc):-
   X =\= H,!,
   compress(T,L2,X,[H|Acc]).
compress([X|T],L2,H,Acc):-
   compress(T,L2,X,Acc).
   